home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d12
/
cxl400.arc
/
CXLDEF.H
< prev
next >
Wrap
Text File
|
1988-11-19
|
4KB
|
132 lines
/*
┌──────────────────────────────────────────────────────────────────────────┐
│ │
│ CXLDEF.H - CXL (c) 1987, 1988 by Mike Smedley. │
│ │
│ This header file contains miscellaneous function prototypes and │
│ definitions. │
│ │
└──────────────────────────────────────────────────────────────────────────┘
*/
#if defined(__TURBOC__)
#if __STDC__
#define _Cdecl
#else
#define _Cdecl cdecl
#endif
#define _Near
#elif defined(__ZTC__)
#define _Cdecl
#define _Near
#elif defined(M_I86) && !defined(__ZTC__)
#if !defined(NO_EXT_KEYS)
#define _Cdecl cdecl
#define _Near near
#else
#define _Cdecl
#define _Near
#endif
#endif
/*---------------------------[ Function Prototypes ]-------------------------*/
char *_Cdecl biosver(void);
int _Cdecl clockcal(void);
void _Cdecl delay_(unsigned duration);
void _Cdecl dispch(int ch);
unsigned _Cdecl expmem(void);
unsigned _Cdecl extmem(void);
void _Cdecl sound_(unsigned pitch,unsigned duration);
char *_Cdecl sysdate(int dtype);
char *_Cdecl systime(int ttype);
int _Cdecl tabstop(int col,int tabwidth);
unsigned long _Cdecl timer(void);
/*-----------------[ definitions for common control codes ]------------------*/
#define NUL 0
#define BEL 7
#define BS 8
#define HT 9
#define LF 10
#define FF 12
#define CR 13
#define ESC 27
/*------------------------[ definition of NULL ]-----------------------------*/
#if !defined(NULL)
#if defined(__TURBOC__)
#if defined(__TINY__) || defined(__SMALL__) || defined(__MEDIUM__)
#define NULL 0
#else
#define NULL 0L
#endif
#elif defined(__ZTC__)
#ifdef LPTR
#define NULL 0L
#else
#define NULL 0
#endif
#elif defined(M_I86) && !defined(__ZTC__)
#if defined(M_I86SM) || defined(M_I86MM)
#define NULL 0
#else
#define NULL 0L
#endif
#endif
#endif
/*-----------------------[ Boolean logic conditions ]------------------------*/
#define NO 0
#define YES 1
#define FALSE 0
#define TRUE 1
#define OFF 0
#define ON 1
/*----------------[ machine ID codes returned from machid() ]----------------*/
#define IBMPC 255 /* IBM PC */
#define IBMPCXT 254 /* IBM PC/XT */
#define IBMPCJR 253 /* IBM PCjr */
#define IBMPCAT 252 /* IBM PC/AT */
#define IBMPCXT2 251 /* IBM PC/XT */
#define IBMCONV 249 /* IBM PC Convertible */
#define SPERRYPC 48 /* Sperry PC */
/*-----------------------[ macro-function definitions ]-----------------------*/
#if !defined(MK_FP)
#define MK_FP(seg,ofs) ((void far *) (((unsigned long)(seg) << 16) | \
(unsigned)(ofs)))
#endif
#if !defined(poke)
#define poke(a,b,c) (*((int far*)MK_FP((a),(b))) = (int)(c))
#define pokeb(a,b,c) (*((char far*)MK_FP((a),(b))) = (char)(c))
#define peek(a,b) (*((int far*)MK_FP((a),(b))))
#define peekb(a,b) (*((char far*)MK_FP((a),(b))))
#endif
#if defined(M_I86) && !defined(__ZTC__)
#define biosequip() _bios_equiplist()
#elif defined(__ZTC__)
#define biosequip() peek(0,0x410)
#endif
#define beep() dispch(BEL)
#define gameport() ((biosequip()&4096)>>12)
#define machid() (unsigned char)peekb(0xf000,0xfffe)
#define mathchip() ((biosequip()&2)>>1)
#define numflop() (((biosequip()&192)>>6)+1)
#define numpar() (((unsigned)(biosequip()&-16384))>>14)
#define numser() ((biosequip()&3584)>>9)